/*
 * @Author: anxia.ack anchenkai@come-future.com
 * @Date: 2025-04-17 17:27:33
 * @LastEditors: anxia.ack anchenkai@come-future.com
 * @LastEditTime: 2025-04-17 17:29:08
 * @FilePath: /free-learning-front/src/utils/local.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
export const localUtils = {
  get: <T>(key: string): T => {
    return JSON.parse(localStorage.getItem(key) || "{}");
  },
  set: <T>(key: string, value: T) => {
    localStorage.setItem(key, JSON.stringify(value));
  },
  remove: (key: string) => {
    localStorage.removeItem(key);
  },
  clear: () => {
    localStorage.clear();
  },
};
